﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for StringUtil
/// </summary>
public class StringUtil
{
	private static readonly string[] VietnameseSigns = new string[]
 
    {
 
        "aAeEoOuUiIdDyY",
 
        "áàạảãâấầậẩẫăắằặẳẵ",
 
        "ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ",
 
        "éèẹẻẽêếềệểễ",
 
        "ÉÈẸẺẼÊẾỀỆỂỄ",
 
        "óòọỏõôốồộổỗơớờợởỡ",
 
        "ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ",
 
        "úùụủũưứừựửữ",
 
        "ÚÙỤỦŨƯỨỪỰỬỮ",
 
        "íìịỉĩ",
 
        "ÍÌỊỈĨ",
 
        "đ",
 
        "Đ",
 
        "ýỳỵỷỹ",
 
        "ÝỲỴỶỸ"
 
    };
 
  
 
    public string RemoveSign4VietnameseString(string str)
 
    {
 
        //Tiến hành thay thế , lọc bỏ dấu cho chuỗi
 
        for (int i = 1; i < VietnameseSigns.Length; i++)
 
        {
 
            for (int j = 0; j < VietnameseSigns[i].Length; j++)
 
                str = str.Replace(VietnameseSigns[i][j], VietnameseSigns[0][i - 1]);
 
        }
 
        return str;
 
    }
}
